<?php 
namespace Home\Controller;
use Think\Controller;
class ShopController extends CommonController{
	public function add(){
		$this->display();
	}

	public function insert(){
		import('ORG.Net.UploadFile');
		import('ORG.Util.Image');

		$upload=new UploadFile();
		$upload->savePath='./Public/uploads/';
		$upload->thumb=true;
		$upload->thumbMaxWidth=200;
		$upload->thumbMaxHeight=200;
		if($upload->upload()){
			$sarr=$upload->getUploadFileInfo();
			$sdir=$sarr[0][savepath];
			$sfile=$sarr[0][savename];	
			$image=new Image();	
			$src=$sdir.$sfile;
			$water=$sdir.'logo.gif';
			$savename=$sdir.'water_'.$sfile;
			$image->water($src,$water,$savename,20);
		}
	}
}
 ?>